import request from '@/utils/request'
import type { Response, PageDataList } from '@/utils/type'

// 查询指标目录
export function queryIndicatorConfigTree(): Promise<Response<PageDataList<any>>> {
  return request({
    url: '/screen/screen/catalog/tree',
    method: 'get'
  })
}


// 新增指标目录
export function addIndicatorCatalog(data: any): Promise<Response<any>> {
  return request({
    url: '/screen/screen/catalog/add',
    method: 'post',
    data
  })
}

// 编辑指标目录
export function updateIndicatorCatalog(data: any): Promise<Response<any>> {
  return request({
    url: '/screen/screen/catalog/update',
    method: 'post',
    data
  })
}


// 删除指标目录
export function deleteIndicatorCatalog(pkid: any): Promise<Response<any>> {
  return request({
    url: `/screen/screen/catalog/delete?pkid=${pkid}`,
    method: 'delete'
  })
}


// 查询行政区划
export function queryDistrict(data: any): Promise<Response<any>> {
  return request({
    url: '/resource/area/manage/query',
    method: 'get',
    params: data
  })
}

// 新增指标配置
export function addIndicatorConfig(data: any): Promise<Response<any>> {
  return request({
    url: '/screen/screen/catalog/index/addRel',
    method: 'post',
    data
  })
}

// 根据区域和目录查询指标配置
export function queryConfigByDistrictAndCatalog(data: any): Promise<Response<any>> {
  return request({
    url: '/screen/screen/catalog/index/queryIndexCommonInfo',
    method: 'get',
    params: data
  })
}

// 根据区域和目录查询已经选择的指标
export function queryConfigByDistrictAndCatalogSelected(data: any): Promise<Response<any>> {
  return request({
    url: '/screen/screen/catalog/index/getSelectIndexIds',
    method: 'get',
    params: data
  })
}


// 根据区域和目录查询已经选择的指标
export function queryConfigByDistrictAndCatalogList(data: any): Promise<Response<any>> {
  return request({
    url: '/screen/screen/catalog/index/getIndexCommonInfo',
    method: 'get',
    params: data
  })
}


